import {
  createRouter,
  createWebHashHistory
} from 'vue-router'

const routes = [{
  name: 'Error404',
  path: '/:error*',
  component: () => import('@/pages/error/404.vue'),
  meta: {
    isLogin: false
  }
},
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/pages/login/index.vue'),
    meta: {
      isLogin: false
    }
  },
  {
    path: '/medicine/service_license',
    name: 'ServiceLicense',
    component: () => import('@/pages/license/index.vue')
  },
  {
    path: '/file_proof',
    name: 'FileProof',
    component: () => import('@/pages/license/index.vue')
  },
  {
    path: '/medicine/tel_license',
    name: 'Tellicense',
    component: () => import('@/pages/license/index.vue')
  },
  {
    path: '/business_license',
    name: 'BusinessLicense',
    component: () => import('@/pages/license/index.vue')
  },
  {
    path: '/',
    redirect: '/overview',
    component: () => import('@/pages/index/index.vue'),
    children: [

      {
        path: '/overview',
        name: 'Overview',
        component: () => import('@/pages/overview/index.vue')
      },
      {
        path: '/statistics',
        name: 'Statistics',
        component: () => import('@/pages/statistics/index.vue')
      },
      {
        path: '/order',
        name: 'Order',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'list'
        }
      },
      {
        path: '/order/pay',
        name: 'OrderPay',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'pay'
        }
      },
      {
        path: '/order/shipment',
        name: 'OrderShipment',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'ship'
        }
      },
      {
        path: '/order/afterSale',
        name: 'OrderAfterSale',
        component: () => import('@/pages/order/index.vue'),
        meta: {
          ori: 'afterSale'
        }
      },
      {
        path: '/order/detail/:id',
        name: 'OrderDetail',
        component: () => import('@/pages/order/detail.vue')
      },
      {
        path: '/order/afterSale/detail/:id',
        name: 'OrderAfterSaleDetail',
        component: () => import('@/pages/order/after.vue')
      },
      {
        path: '/order/pay/audit/:id',
        name: 'OrderPayDetail',
        component: () => import('@/pages/order/detail.vue'),
        meta: {
          ori: 'payAudit'
        }
      },

      {
        path: '/reagent',
        name: 'Reagent',
        component: () => import('@/pages/order/index.vue')
      },


      {
        path: '/goods/category',
        name: 'GoodsCategory',
        component: () => import('@/pages/goods/category.vue')
      },
      {
        path: '/goods/tag',
        name: 'GoodsTag',
        component: () => import('@/pages/goods/tag.vue')
      },
      {
        path: '/goods/license',
        name: 'GoodsLicense',
        component: () => import('@/pages/goods/license.vue')
      },
      {
        path: '/goods',
        name: 'Goods',
        component: () => import('@/pages/goods/index.vue')
      },
      {
        path: '/goods/edit/:id',
        name: 'GoodsEditId',
        component: () => import('@/pages/goods/edit.vue')
      },
      {
        path: '/goods/edit',
        name: 'GoodsEdit',
        component: () => import('@/pages/goods/edit.vue')
      },
      {
        path: '/goods/add',
        name: 'GoodsAdd',
        component: () => import('@/pages/goods/edit.vue')
      },
      {
        path: '/goods/audit',
        name: 'GoodsAudit',
        component: () => import('@/pages/goods/audit.vue')
      },
      {
        path: '/goods/goodsDetail/:id',
        name: 'GoodsDetail',
        component: () => import('@/pages/goods/detail.vue')
      },
      {
        path: '/goods/audit/goodsDetail/:id',
        name: 'AuditGoodsDetail',
        component: () => import('@/pages/goods/detail.vue'),
        meta: {
          ori: 'goodsAudit'
        }
      },

      {
        path: '/supplier',
        name: 'Supplier',
        component: () => import('@/pages/supplier/index.vue'),
        meta: {
          ori: 'list'
        }

      },
      {
        path: '/supplier/license',
        name: 'SupplierLicense',
        component: () => import('@/pages/supplier/license.vue')
      },
      {
        path: '/supplier/account',
        name: 'SupplierAccount',
        component: () => import('@/pages/supplier/index.vue'),
        meta: {
          ori: 'account'
        }
      },
      {
        path: '/supplier/cate',
        name: 'SupplierCate',
        component: () => import('@/pages/supplier/index.vue'),
        meta: {
          ori: 'cate'
        }
      },

      {
        path: '/supplier/detail/:id',
        name: 'SupplierDetail',
        component: () => import('@/pages/supplier/detail.vue'),
        meta: {
          ori: 'supplierDetail'
        }
      },

      {
        path: '/supplier/accountDetail/:id',
        name: 'SupplierAccountDetail',
        component: () => import('@/pages/supplier/audit.vue'),
        meta: {
          ori: 'supplierAccount'
        }
      },
      {
        path: '/supplier/cateDetail/:id',
        name: 'SupplierCateDetail',
        component: () => import('@/pages/supplier/audit.vue'),
        meta: {
          ori: 'supplierCate'
        }
      },

      {
        path: '/customer',
        name: 'Customer',
        component: () => import('@/pages/customer/index.vue'),
        meta: {
          ori: 'list'
        }
      },
      {
        path: '/customer/license',
        name: 'CustomerLicense',
        component: () => import('@/pages/customer/license.vue')
      },
      {
        path: '/customer/account',
        name: 'CustomerAccount',
        component: () => import('@/pages/customer/index.vue'),
        meta: {
          ori: 'account'
        }
      },
      {
        path: '/customer/cate',
        name: 'CustomerCate',
        component: () => import('@/pages/customer/index.vue'),
        meta: {
          ori: 'cate'
        }
      },
      {
        path: '/customer/detail/:id',
        name: 'customerDetail',
        component: () => import('@/pages/customer/detail.vue'),
        meta: {
          ori: 'customerDetail'
        }
      },
      {
        path: '/customer/accountDetail/:id',
        name: 'customerAccountDetail',
        component: () => import('@/pages/customer/audit.vue'),
        meta: {
          ori: 'customerAccount'
        }
      },
      {
        path: '/customer/cateDetail/:id',
        name: 'customerCateDetail',
        component: () => import('@/pages/customer/audit.vue'),
        meta: {
          ori: 'customerCate'
        }
      },
      {
        path: '/home',
        name: 'Home',
        component: () => import('@/pages/home/index.vue')
      },
      {
        path: '/home/goodsPreview',
        name: 'HomeGoodsPreview',
        component: () => import('@/pages/home/components/preview.vue')
      },
      {
        path: '/staff/authority',
        name: 'Authority',
        component: () => import('@/pages/staff/authority.vue')
      },
      {
        path: '/staff/employee',
        name: 'Employee',
        component: () => import('@/pages/staff/employee.vue')
      },
      {
        path: '/member',
        name: 'Member',
        component: () => import('@/pages/member/index.vue')
      },
      {
        path: '/member/detail/:id',
        name: 'MemberDetail',
        component: () => import('@/pages/member/levelEdit.vue')
      },
      {
        path: '/supplier/member',
        name: 'SupplierMember',
        component: () => import('@/pages/member/supplier.vue')
      },
      {
        path: '/supplier/memberExaminer/:id/:status',
        name: 'memberExaminer',
        component: () => import('@/pages/member/examine.vue')
      }
    ]
  }

]

export default createRouter({
  history: createWebHashHistory(),
  routes
})
